/**
 * @(#)com.framework.web.bus.domain.Order
 *
 * Copyright (c) 2014-2018 ﻿上海XX科技有限公司
 *
 * DESC:
 *
 */
package com.framework.web.bus.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.framework.core.domain.IdEntity;
import com.framework.web.sys.domain.User;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;


/**
 * @author zqtao
 * @version 1.0  2016-9-11
 */
@Entity
@javax.persistence.Table(name = "t_bus_order")
public class Order extends IdEntity implements java.io.Serializable {


    private Date orderDate;
    private Double totalAmount;
    private Double cashPayment;
    private Double couponPayment;
    private String userId;
    private String shippingAddress;
    private String shippingName;
    private String shippingTel;

    @Temporal(TemporalType.DATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date buyTime; //付款时间
    private String postCode;
    private String buyerMsg;
    private String remarks;
    private Integer userVisual;
    private String streamType;
    private Integer orderStatus;
    private String trackingNo;
    private String updateName;
    private String createBy;

    @Temporal(TemporalType.DATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;
    private String updateBy;

    @Temporal(TemporalType.DATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;

    private User user;
    //快递状态
    private Integer expressStatus;
    //快递查询时间
    private Date queryTime;


    @Basic
    @Column(name = "ORDER_DATE")
    public Date getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }


    @Basic
    @Column(name = "TOTAL_AMOUNT")
    public Double getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(Double totalAmount) {
        this.totalAmount = totalAmount;
    }


    @Basic
    @Column(name = "CASH_PAYMENT")
    public Double getCashPayment() {
        return cashPayment;
    }

    public void setCashPayment(Double cashPayment) {
        this.cashPayment = cashPayment;
    }


    @Basic
    @Column(name = "COUPON_PAYMENT")
    public Double getCouponPayment() {
        return couponPayment;
    }

    public void setCouponPayment(Double couponPayment) {
        this.couponPayment = couponPayment;
    }


    @Basic
    @Column(name = "USER_ID")
    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }


    @Basic
    @Column(name = "SHIPPING_ADDRESS")
    public String getShippingAddress() {
        return shippingAddress;
    }

    public void setShippingAddress(String shippingAddress) {
        this.shippingAddress = shippingAddress;
    }


    @Basic
    @Column(name = "SHIPPING_NAME")
    public String getShippingName() {
        return shippingName;
    }

    public void setShippingName(String shippingName) {
        this.shippingName = shippingName;
    }


    @Basic
    @Column(name = "SHIPPING_TEL")
    public String getShippingTel() {
        return shippingTel;
    }

    public void setShippingTel(String shippingTel) {
        this.shippingTel = shippingTel;
    }


    @Basic
    @Column(name = "POST_CODE")
    public String getPostCode() {
        return postCode;
    }

    public void setPostCode(String postCode) {
        this.postCode = postCode;
    }


    @Basic
    @Column(name = "BUYER_MSG")
    public String getBuyerMsg() {
        return buyerMsg;
    }

    public void setBuyerMsg(String buyerMsg) {
        this.buyerMsg = buyerMsg;
    }


    @Basic
    @Column(name = "REMARKS")
    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }


    @Basic
    @Column(name = "STREAM_TYPE")
    public String getStreamType() {
        return streamType;
    }

    public void setStreamType(String streamType) {
        this.streamType = streamType;
    }


    @Basic
    @Column(name = "TRACKING_NO")
    public String getTrackingNo() {
        return trackingNo;
    }

    public void setTrackingNo(String trackingNo) {
        this.trackingNo = trackingNo;
    }


    @Basic
    @Column(name = "ORDER_STATUS")
    public Integer getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }


    @Basic
    @Column(name = "USER_VISUAL")
    public Integer getUserVisual() {
        return userVisual;
    }

    public void setUserVisual(Integer userVisual) {
        this.userVisual = userVisual;
    }


    @Basic
    @Column(name = "CREATE_BY")
    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    private String createName;

    @Basic
    @Column(name = "CREATE_NAME")
    public String getCreateName() {
        return createName;
    }

    public void setCreateName(String createName) {
        this.createName = createName;
    }


    @Basic
    @Column(name = "CREATE_TIME")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }


    @Basic
    @Column(name = "UPDATE_BY")
    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }


    @Basic
    @Column(name = "UPDATE_NAME")
    public String getUpdateName() {
        return updateName;
    }

    public void setUpdateName(String updateName) {
        this.updateName = updateName;
    }


    @Basic
    @Column(name = "UPDATE_TIME")
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }


    @ManyToOne(targetEntity = User.class)
    @JoinColumn(name = "USER_ID", insertable = false, updatable = false)
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @Basic
    @Column(name = "BUY_TIME")
    public Date getBuyTime() {
        return buyTime;
    }

    public void setBuyTime(Date buyTime) {
        this.buyTime = buyTime;
    }

    @Basic
    @Column(name = "EXPRESS_STATUS")
    public Integer getExpressStatus() {
        return expressStatus;
    }

    public void setExpressStatus(Integer expressStatus) {
        this.expressStatus = expressStatus;
    }
    @Basic
    @Column(name = "QUERY_TIME")
    public Date getQueryTime() {
        return queryTime;
    }

    public void setQueryTime(Date queryTime) {
        this.queryTime = queryTime;
    }
}
